def reverse_words_in_sentence(sentence):
    # 检查输入是否为字符串
    if not isinstance(sentence, str):
        raise TypeError("Input must be a string")

    # 处理空字符串
    if not sentence:
        return ""

    # 使用正则表达式处理多个连续空格
    import re
    words = re.split(r'(\s+)', sentence)
    
    # 反转单词列表
    reversed_words = words[::-1]
    
    # 重新组合成句子
    reversed_sentence = ''.join(reversed_words)
    
    return reversed_sentence

# 测试函数
test_sentence = "hello xiao mi"
reversed_sentence = reverse_words_in_sentence(test_sentence)
print(reversed_sentence)  # 输出: "mi xiao hello"